package game;

import java.util.*;
import java.awt.Color;

public class Block {
	public Block( ) {
		n = 0; x = 4; y = 0;
		//this.c = c;		
		frames = new Vector<BlockFrame>();
	}
	
	public void addFrame( BlockFrame f ) {
		frames.add(f);
	}
	
	public BlockFrame nextFrame() {
		n++;
		n = n % frames.size();
		return frames.get(n);
	}
	
	public BlockFrame previousFrame() {
		n = (n+frames.size()-1) % frames.size();
		return frames.get(n);
	}
	
	public BlockFrame getBlock() {
		return frames.get(n);
	}
	
	public BlockFrame getFirstFrame() {
		return frames.get(0);
	}
	
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	/*public Color getColor() {
		return c;
	}*/
	
	public void setPos( int x, int y ) {
		if( x >= 0 && x <= 10-frames.get(n).getWidth() )
			this.x = x;
		
		this.y = y;
	}
	
	private Vector<BlockFrame> frames;
	//private Color c;
	int n;
	int x, y;
}
